*/
#include "defs.h"
-#include "zlib/zconf.h"
#include "gbfile.h"
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
-#include <QtCore/QDebug>
#if __WIN32__
-Unmodified wubset of zlib-1.2.8 from zlib.net.
+modified subset of zlib-1.2.8 from zlib.net.
+1. zconf.h is modified to include our config.h
+2. gzlib.c is modified to resolve a seek problem with uncompressed files on windows platforms build with mingw32 gcc.
+see gzlib.patch
+
/* if within raw area while reading, just go there */
if (state->mode == GZ_READ && state->how == COPY &&
state->x.pos + offset >= 0) {
- ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR);
+/* Start GPSBabel local */
+/* ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR); */
+ ret = LSEEK(state->fd, offset - (z_off64_t)state->x.have, SEEK_CUR);
+/* end GPSBabel local */
if (ret == -1)
return -1;
state->x.have = 0;
--- /dev/null
+--- gzlib.c 2014-04-28 16:19:19.839086477 -0600
++++ gzlib.patch.c 2014-04-28 16:18:31.220835104 -0600
+@@ -393,7 +393,10 @@
+ /* if within raw area while reading, just go there */
+ if (state->mode == GZ_READ && state->how == COPY &&
+ state->x.pos + offset >= 0) {
+- ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR);
++/* Start GPSBabel local */
++/* ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR); */
++ ret = LSEEK(state->fd, offset - (z_off64_t)state->x.have, SEEK_CUR);
++/* end GPSBabel local */
+ if (ret == -1)
+ return -1;
+ state->x.have = 0;